package com.mkait.thief.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName invite_code
 */
@TableName(value ="invite_code")
@Data
public class InviteCode implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 所有者ID
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 邀请码
     */
    @TableField(value = "code")
    private String code;

    /**
     * 使用状态 0未使用 1已使用
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 受邀用户ID
     */
    @TableField(value = "invite_uid")
    private Integer inviteUid;

    /**
     * 邀请时间
     */
    @TableField(value = "invite_at")
    private Integer inviteAt;

    /**
     * 创建时间
     */
    @TableField(value = "create_at")
    private Integer createAt;

    /**
     * 
     */
    @TableField(value = "expire_at")
    private Integer expireAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        InviteCode other = (InviteCode) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getInviteUid() == null ? other.getInviteUid() == null : this.getInviteUid().equals(other.getInviteUid()))
            && (this.getInviteAt() == null ? other.getInviteAt() == null : this.getInviteAt().equals(other.getInviteAt()))
            && (this.getCreateAt() == null ? other.getCreateAt() == null : this.getCreateAt().equals(other.getCreateAt()))
            && (this.getExpireAt() == null ? other.getExpireAt() == null : this.getExpireAt().equals(other.getExpireAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getInviteUid() == null) ? 0 : getInviteUid().hashCode());
        result = prime * result + ((getInviteAt() == null) ? 0 : getInviteAt().hashCode());
        result = prime * result + ((getCreateAt() == null) ? 0 : getCreateAt().hashCode());
        result = prime * result + ((getExpireAt() == null) ? 0 : getExpireAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", code=").append(code);
        sb.append(", status=").append(status);
        sb.append(", inviteUid=").append(inviteUid);
        sb.append(", inviteAt=").append(inviteAt);
        sb.append(", createAt=").append(createAt);
        sb.append(", expireAt=").append(expireAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}